﻿@using Sausage.Common
@using Sausage.Web.Models
@using Telerik.Web.Mvc.UI
@using Telerik.Web.Mvc.UI.Fluent
@{
    ViewBag.Title = "图";
    Layout = "~/Views/Shared/MainLayout.cshtml";
}

@section HeadCssLink
{
    @Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.rtl.css").Combined(false).Compress(false))
}
@section HeadScriptLink
{
    @Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("telerik.common.js").Add("telerik.draganddrop.js").Add("telerik.window.js").Add("telerik.chart.js")).jQuery(false)
}
<div>
    @{
        Html.Telerik().Chart<ComparedData>()
            .Name("ColumnChart")
            .Title(title => title.Text("养护计划与实际养护情况对比").Font("normal bold 18px arial,sans-serif;"))
            .Legend(legend => legend.Position(ChartLegendPosition.Right).Font("normal bold 13px arial,sans-serif;"))
            .Series(series =>
                        {
                            series.Column("PlanValue").Name("计划情况").Labels(true);
                            series.Column("RealValue").Name("实际情况")
                                .Labels(labels => labels
                                                      .Position(ChartBarLabelsPosition.InsideEnd)
                                                      .Visible(true)
                                );
                        })
            .CategoryAxis(axis => axis.Categories( data => data.DataCategory))
            .Tooltip(tooltip => tooltip.Visible(true).Opacity(0.50).Template("<#= value #>"))
            .DataBinding(dataBinding => dataBinding.Ajax().Select("SpainColumnChart", "Chart"))
            .HtmlAttributes(new {style = "width: 670px; height: 500px;"}).Render();
    }

    @Html.Telerik().ScriptRegistrar().jQuery(false).jQueryValidation(false)
</div>